<template>
  <div>
    <!-- 订单切换 -->
    <!-- 我的订单 -->
    <van-nav-bar
      title="我的订单"
      left-text="返回"
      left-arrow
      @click-left="
        () => {
          $router.push('/home/my');
        }
      "
    />
    <!-- 切换 -->
     <van-tabs v-model:active="active">
  <van-tab title="全部">
    <!-- 订单 -->
    <div v-for="item in orderData" style="width: 100%;height: 140px;margin-left: 5px;">
        <p>名称：{{ item.goods_name }}</p>
        <p>订单号:{{ item.add_time }}</p>
        <p>价格:{{ item.goods_price }}</p>
    </div>
  </van-tab>
  <van-tab title="我的订单">
     <!-- 空状态 -->
     <van-empty image="error" description="暂无订单数据" />
  </van-tab>
  <van-tab title="待支付">
     <!-- 空状态 -->
     <van-empty image="error" description="暂无未支付数据" />
  </van-tab>
  <van-tab title="已到货">
    <!-- 空状态 -->
     <van-empty image="error" description="暂无订单数据" />
  </van-tab>
</van-tabs>
  </div>
</template>

<script setup>
import {ref} from 'vue'
let orderData = ref([]);
import { orderApi } from "@/api/api";
orderApi().then((res) => {
  console.log("订单数据", res);
  orderData.value = res.data.message.goods;
});
</script>

<style lang="scss" scoped>
</style>